import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../pages/Home.vue'
import LoginView from '../pages/Login.vue'
import Register from '../pages/Register.vue'
import ForgotPassword from '../pages/ForgotPassword.vue'
import BokeView from '../pages/BokeInfo.vue'
import AllBoke from '../pages/AllBoke.vue'
import HotBoke from '../pages/HotBoke.vue'
import UserUpdate from '../pages/UserUpdate.vue'
import BokeColumn from '../pages/BokeColumn.vue'
import FakeBokeInfo from '../pages/FakeBokeInfo.vue'
import MyBoke from '../pages/MyBoke.vue'
import AddBokeInfo from '../pages/AddBokeInfo.vue'
import Search from '../pages/Search.vue'
import Pt from '../pages/Pt.vue'
import LosePWD from '../pages/LosePWD.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
    {
      path: '/',
      name: 'login',
      component:() => LoginView
    },
    {
      path: '/home',
      name: 'home',
      component:() => HomeView
    },
    {
      path: '/register',
      name: 'Register',
      component:() => Register,
    },
    {
      path: '/forgot-password',
      name: 'ForgotPassword',
      component:() => ForgotPassword,
    },
    {
      path: '/addbokeinfo',
      name: 'AddBokeInfo',
      component:() => AddBokeInfo,
    },
    {
      path: '/bokeinfo/:PostId',
      name: 'BokeInfo',
      component:() => BokeView,
      prop:true
    },
    {
      path: '/myboke/:UserID',
      name: 'MyBoke',
      component: () => MyBoke,
      props: true
    },
    {
      path:'/fakebokeinfo',
      name: 'FakeBokeInfo',
      component:() => FakeBokeInfo
    },
    {
      path: '/admin/login',
      name: 'logAdmin',
      component:() => import('../pages/AdminLogin.vue'),
    },
    {
      path: '/admin/home',
      name: 'AdminHome',
      component:() => import('../pages/AdminHome.vue'),
      children: [
        {
          path:'/admin/home/user',
          name:'UserManage',
          component:() => import('../pages/Manage_User.vue')
        },
        {
          path:'/admin/home/boke',
          name:'BokeManage',
          component:() => import('../pages/Manage_Boke.vue')
        },
        {
          path:'/admin/home/comment',
          name:'CommentManage',
          component:() => import('../pages/Manage_Comment.vue')
        },
      ]
    },
    {
      path:'/allboke',
      name:'allboke',
      component:() => AllBoke
    },
    {
      path: '/hotboke',
      name: 'hotboke',
      component:() => HotBoke
    },
    {
      path: '/userupdate',
      name: 'userupdate',
      component:() => UserUpdate
    },
    {
      path:'/bokecolumn',
      name:'bokecolumn',
      component:() => BokeColumn,
    },
    {
      path:'/search',
      name:'search',
      component:() => Search,
    },
    {
      path:'/pt',
      name:'Pt',
      component:() => Pt,
    },
    {
      path:'/losePWD',
      name:'LosePWD',
      component:() => LosePWD,
    }
    ]
})
export default router